home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / vbcc / machines / amiga68k / doc / fd2lib.doc next >
Encoding:
Text File  |  1995-11-23  |  2.9 KB  |  90 lines

  1. fd2lib by Volker Barthelmann
  2.  
  3.  
  4. INTRODUCTION
  5.  
  6.     fd2lib takes .fd-files as input and generates assembler source to
  7.     create a library with stubs to call the functions (including stubs
  8.     for varargs functions).
  9.     It will create stubs suitable for vbcc, i.e. restore all necessary
  10.     registers (including a6) etc.
  11.  
  12.  
  13. LEGAL
  14.  
  15.     fd2lib is public domain.
  16.  
  17.  
  18. USAGE
  19.  
  20.     fd2lib [options] .fd-files
  21.  
  22.     options at the moment can be:
  23.  
  24.     -sc     generate small code stubs (not really useful)
  25.     -sd     generate small data stubs
  26.     -prof   generate code with profiling (not yet implemented)
  27.  
  28.     fd2lib will process all the .fd-files specified at the command line
  29.     and will generate an assembler source for each library function as
  30.     T:functionname.s and a file containing all the library vector offsets
  31.     as T:fd-file_LVO.s
  32.  
  33.  
  34. VARARGS
  35.  
  36.     Some functions take a pointer to a list of arguments as the last
  37.     argument. fd2lib has a hardcoded list of such function and creates
  38.     additional stubs that can be called with a variable number of arguments
  39.     from C (e.g. OpenWindowTagList and OpenWindowTags).
  40.  
  41.     If You want to extend this list, You have to add the name of the
  42.     function and the name of the varargs function to the file vargs.h
  43.     and recompile fd2lib.
  44.  
  45.  
  46. CREATING LIBRARIES
  47.  
  48.     If You want to create a library from some .fd-files proceed like this:
  49.  
  50.     delete t:#?.(s|o) quiet
  51.     fd2lib <all the .fd-files You want>
  52.     (copying FreePhxAss to ram: now may speed up the process)
  53.     vc -c T:#?.s
  54.     join T:#?.o to <name of resulting lib>
  55.     delete T:#?.(s|o)
  56.  
  57.  
  58. MakeALIB.script
  59.  
  60.     This is a small script which will create an amiga.lib in T:. It
  61.     will delete files from T: before and assumes nothing is written to T:
  62.     while it is running.
  63.  
  64.     You have to assign FD: to a directory that contains the .fd-files for
  65.     the Amiga shared libraries and cd into the libsrc/AmigaLib directory
  66.     and start it from there.
  67.  
  68.     It will then create all library stubs and LVOs with fd2lib (this will
  69.     result in many many small files in T: which will be assembled by
  70.     FreePhxAss - so having FreePhxAss in RAM: will speed it up quite a
  71.     lot).
  72.     Then the support routines in libsrc/AmigaLib will be compiled/assembled
  73.     and the resulting object files will be put in t:, too. You must have
  74.     the C= includes.
  75.     The support routines are taken from libnix and have been changed a bit
  76.     to work with vbcc. I have not tested them and several support routines
  77.     from the original amiga.lib are missing.
  78.  
  79.     The whole process may take quite some time and a few MB space in T:
  80.     The resulting amiga.lib should be free from any copyright and is a
  81.     rather good (but not complete) replacement for the original amiga.lib
  82.     and can be copied to vlib:.
  83.  
  84.     A small-data-amigas.lib can be created the same way (MakeALIBS.script
  85.     should already be there).
  86.  
  87.  
  88. Volker Barthelmann                                      volker@vb.franken.de
  89.  
  90.